import {get,post} from "./http";

// 判断管理员是否登录成功
export const getLoginStatus = (params) => post(`admin/login/status`,params);

// ===================歌手相关接口=======================
//查询歌手
export const getAllSinger =() =>get(`singer/allSinger`)
// 添加歌手
export const setSinger=(params) =>post(`singer/add`,params)
// 修改歌手
export const updateSigner=(params) =>post(`singer/update`,params)
// 删除歌手
export const delteSinger=(id) =>get(`singer/delete?id=${id}`)

// ===================歌曲相关接口=======================
export const SongofSingerId=(id) => get(`song/singer/detail?singer_id=${id}`)
// 查询所有歌曲
export const getallSong=() =>get(`song/allSong`)
// 修改歌曲
export const updateSong=(params) =>post(`song/update`,params)
// 删除歌曲
export const delteSong=(id) =>get(`song/delete?id=${id}`)
// 根据歌曲id查询歌曲对象
export const SongofSongId=(id) => get(`song/songOfsong_id?song_id=${id}`)
// 根据歌曲名获取歌曲对象
export const SongofSongName=(songName) => get(`song/SongofSongName?songName=${songName}`)

// ===================歌单相关接口=======================
//查询歌单
export const getAllSongList =() =>get(`songList/allSongList`)
// 添加歌单
export const setSongList=(params) =>post(`songList/add`,params)
// 修改歌单
export const updateSongList=(params) =>post(`songList/update`,params)
// 删除歌单
export const delteSongList=(id) =>get(`songList/delete?id=${id}`)

// ===================歌单的歌曲相关接口=======================
//根据歌单id查询
export const getListSongDetail =(song_list_id) =>get(`list_song/detail?song_list_id=${song_list_id}`)
// 添加歌单的歌曲
export const setListSongAdd=(params) =>post(`list_song/add`,params)
// 删除歌单的歌曲
export const delteListSong=(song_id,song_list_id) =>get(`list_song/deleteBysong_idAndsong_list_id?song_id=${song_id}&song_list_id=${song_list_id}`)

// ===================歌手相关接口=======================
//查询歌手
export const getAllConsumer =() =>get(`consumer/allConsumer`)
// 添加歌手
export const setConsumer=(params) =>post(`consumer/add`,params)
// 修改歌手
export const updateConsumer=(params) =>post(`consumer/update`,params)
// 删除歌手
export const delteConsumer=(id) =>get(`consumer/delete?id=${id}`)

// ===================收藏相关接口=======================
// 查询用户收藏
export const getCollectOfUserId =(user_id) =>get(`collect/collectOfUserId?user_id=${user_id}`)
// 删除用户收藏
export const delteCollect = (user_id,song_id) => get(`collect/deleteByUserIdAndSongId?user_id=${user_id}&song_id=${song_id}`);
